#####################################################################################
## MOD Title: RPG PLUS
## MOD Author: Darkmonkey <info@darkmonkeydesigns.com> (Brendan kettle) http://www.darkmonkeydesigns.com
## MOD Description: Provides a full RPG system for your forum (see features.txt)
## MOD Version: 1.0.0 beta
##
## Installation Level: Intermediate
## Installation Time: 60 Minutes (2 Minutes with EasyMOD)
## Files To Edit:
##		admin/index.php
##		admin/admin_forums.php
##		admin/admin_users.php
##		includes/constants.php
##		includes/functions.php
##		includes/functions_post.php
##		includes/page_header.php
##		includes/usercp_register.php
##		includes/usercp_viewprofile.php
##		language/lang_english/lang_admin.php
##		templates/subSilver/admin/forum_edit_body.tpl
##		templates/subSilver/admin/user_edit_body.tpl
##		templates/subSilver/memberlist_body.tpl
##		templates/subSilver/overall_header.tpl
##		templates/subSilver/profile_add_body.tpl
##		templates/subSilver/profile_view_body.tpl
##		templates/subSilver/subSilver.cfg
##		templates/subSilver/viewtopic_body.tpl
##		common.php
##		memberlist.php
##		posting.php
##		viewforum.php
##		viewonline.php
##		viewtopic.php
##
## Included Files:
##		admin/admin_ai.php
##		admin/admin_ai_attacks.php
##		admin/admin_areas.php
##		admin/admin_battles.php
##		admin/admin_elements.php
##		admin/admin_jobs.php
##		admin/admin_races.php
##		admin/admin_points.php
##		admin/admin_rpg_options.php
##		admin/admin_rpgitems.php
##		admin/admin_rpghelp.php
##		admin/admin_rpgshop.php
##		includes/functions_points.php
##		includes/functions_rpgstats.php
##		includes/battle.php
##		items/adreno.php
##		items/ether.php
##		items/potion.php
##		items/scan.php
##		items/steal.php
##		language/lang_english/email/user_notify_donation.tpl
##		language/lang_english/lang_rpg_admin.php
##		language/lang_english/lang_rpg_stats.php
##		language/lang_english/lang_rpg_shop.php
##		templates/subSilver/admin/ai_config_body.tpl
##		templates/subSilver/admin/ai_edit_body.tpl
##		templates/subSilver/admin/ai_attacks_edit_body.tpl
##		templates/subSilver/admin/ai_attacks_config_body.tpl
##		templates/subSilver/admin/admin_view_logs_body.tpl
##		templates/subSilver/admin/admin_view_taunts_body.tpl
##		templates/subSilver/admin/area_config_body.tpl
##		templates/subSilver/admin/area_edit_body.tpl
##		templates/subSilver/admin/battle_edit_body.tpl
##		templates/subSilver/admin/battle_manage_body.tpl
##		templates/subSilver/admin/elements_config_body.tpl
##		templates/subSilver/admin/elements_edit_body.tpl
##		templates/subSilver/admin/item_config_body.tpl
##		templates/subSilver/admin/item_edit_body.tpl
## 		templates/subSilver/admin/jobs_config_body.tpl
##		templates/subSilver/admin/jobs_edit_body.tpl
##		templates/subSilver/admin/points_config_body.tpl
##		templates/subSilver/admin/races_config_body.tpl
##		templates/subSilver/admin/races_edit_body.tpl
##		templates/subSilver/admin/rpghelp_config_body.tpl
##		templates/subSilver/admin/rpghelp_edit_body.tpl
##		templates/subSilver/admin/rpgoptions_config_body.tpl
##		templates/subSilver/admin/rpgoptions_level_reset.tpl
##		templates/subSilver/admin/rpgshop_config_body.tpl
##		templates/subSilver/admin/rpgshop_edit_body.tpl
##		templates/subSilver/ai_arena_body.tpl
##		templates/subSilver/arena_enter_body.tpl
##		templates/subSilver/hospital_body.tpl
##		templates/subSilver/points_system.tpl
##		templates/subSilver/pvsp_arena_body.tpl
##		templates/subSilver/rpg_body.tpl
##		templates/subSilver/rpgcp_body.tpl
##		templates/subSilver/rpghelp_list_body.tpl
##		templates/subSilver/rpghelp_view_body.tpl
##		templates/subSilver/rpgprofile_body.tpl
##		templates/subSilver/rpgstats_body.tpl
##		templates/subSilver/rpgworld_body.tpl
##		templates/subSilver/shop_body.tpl
##		templates/subSilver/store_body.tpl
##		templates/subSilver/view_ai_body.tpl
##		templates/subSilver/view_jobs_body.tpl
##		templates/subSilver/view_logs.tpl
##		templates/subSilver/view_pvsp_body.tpl
##		templates/subSilver/view_races_body.tpl
##		templates/subSilver/view_taunts.tpl
##		arena.php
##		hospital.php
##		pointscp.php
##		rpg.php
##		rpg_install.php
##		rpgcp.php
##		rpghelp.php
##		rpgshop.php
##		rpgstats.php
##		taunt.php
##
## + all images in images/rpgplus/ and template directorys
## + all sounds in sounds/ directory
##
#####################################################################################
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the 
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code 
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered 
## in our MOD-Database, located at: http://www.phpbb.com/mods/ 
###################################################################################
## Author Notes:
## You should change all your languages and themes if you use others
## then English and subSilver. This mod was made for version 2.0.13
## of phpBB.
##
## Thanks to [frost.] for the graphics help, and wgEric for the pm function ^_^
##
## The points MOD has been intergrated(and modified) into the code aswell,  
## so thanks to the many authors of it ^_^
##
## Installation:
##
## 1) Upload all files in root/ to their respective locations.
## 2) Run rpg_install.php to make the database changes
## 3) Read below to make the rest of the changes.
## 
####################################################################################
## MOD History: 
##
##   2004-1-24 - Version 0.1.0 beta is finished 
##		- Finished stage one of RPG plus, and decided to beta release
##		what I've done so far.
##
##   2004-2-13 - Version 0.1.1 beta is finished 
##		- After a computer crash, had to recode alot of features. Added Gender,
##		alot of on/off functions and fixed all known bugs and took away alignment 
##		table
##
##   2004-2-13 - Version 0.1.2 beta is finished 
##		- Fixed some exp/stat bugs
##		- Took away race influences exp
##
##   2004-3-17 - Version 0.3.0 beta is finished 
##		- Added Shop
##		- Added Rpg home
##		- Alot of other small fixes and features
##
##   2004-7-15 - Version 0.5.0 beta is finished 
##		- Added Arena
##		- Updated admin panels
##		- Added hospital
##		- Added RPG profile
##		- Alot of other small fixes and features
##		- Took away rpg_options table
##
##   2004-8-7 - Version 0.5.1 beta is finished 
##		- earning exp bug fixed
##		- smilies in battle taunts
##		- all template images specific
##		- template bug fixed
##		- cant heal while in battle
##		- double opponents bug fixed
##		- rpg profile bug fix
##		- admin user update bug fixed
##		- other small fixes
##
##   2004-10-24 - Version 0.7.0 beta is finished
##		- MySql 3 > compatiable (No multiple table updates)
##		- Updated lang includes
##		- "life" function in hospital
##		- exp carries on levelup
##		- sort by level in memberlist
##		- Random forum battles
##		- minus level bug fix
##		- Admin definable AI Enemies, and Ai Attacks
##		- Viewonline (session whereabouts) added
##		- View opponent profile added (from pm)
##		- Surrender bug fix
##
##   2004-03-12 - 1.0.0 RC1 is released
##		- Add "Rpgworld"
##		- Rpg Statisitcs Page added
##		- Rpg help center added with admin configurable articles
##		- Added online/offline function for rpg pages
##		- master select function introduced
##		- documentation written
##		- security checks
##		- Added contrib DB fill scripts
##		- added "use forum avatar" option for avatars
##		- notify of new battle turn through pm (on/off)
##		- added item "type" field
##		- use items from shop
##		- Various small bug fixes
##		- Intergrated points MOD (modified 2.1.1)
##
#########################################################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
#########################################################################################

#
#-----[ COPY ]------------------------------------------ 
#
copy *.* to *.*

#
#-----[ OPEN ]------------------------------------------
#
admin/index.php

#
#-----[ FIND ]------------------------------------------
#

require('./pagestart.' . $phpEx);

#
#-----[ AFTER, ADD ]------------------------------------------
#

// RPG PLUS
if ( !file_exists(@phpbb_realpath($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_rpg_admin.'.$phpEx)) )
{
	include($phpbb_root_path . 'language/lang_english/lang_rpg_admin.' . $phpEx);
}
else
{
	include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_rpg_admin.' . $phpEx);
}
// RPG PLUS

#
#-----[ FIND ]------------------------------------------
#

						case PAGE_FAQ:
							$location = $lang['Viewing_FAQ'];
							$location_url = "index.$phpEx?pane=right";
							break;
							
#
#-----[ AFTER, ADD ]------------------------------------------
#

						//RPGPLUS
						case PAGE_ARENA:
							$location = $lang['Viewing_arena'];
							$location_url = "arena.$phpEx";
							break;
						case PAGE_HOSPITAL:
							$location = $lang['Viewing_hospital'];
							$location_url = "hospital.$phpEx";
							break;
						case PAGE_RPGSHOP:
							$location = $lang['Viewing_rpgshop'];
							$location_url = "rpgshop.$phpEx";
							break;
						case PAGE_RPGHOME:
							$location = $lang['Viewing_rpghome'];
							$location_url = "rpgcp.$phpEx";
							break;
						case PAGE_RPGPROFILE:
							$location = $lang['Viewing_rpgprofile'];
							$location_url = "index.$phpEx";
							break;
						case PAGE_RPGWORLD:
							$location = $lang['Viewing_rpgworld'];
							$location_url = "rpg.$phpEx";
							break;
						case PAGE_RPGSTATS:
							$location = $lang['Viewing_rpgstats'];
							$location_url = "rpgstats.$phpEx";
							break;
						case PAGE_RPGHELP:
							$location = $lang['Viewing_rpghelp'];
							$location_url = "rpghelp.$phpEx";
							break;
						// END RPGPLUS

#
#-----[ FIND ]------------------------------------------
#

					case PAGE_FAQ:
						$location = $lang['Viewing_FAQ'];
						$location_url = "index.$phpEx?pane=right";
						break;
	
#
#-----[ AFTER, ADD ]------------------------------------------
#

						//RPGPLUS
						case PAGE_ARENA:
							$location = $lang['Viewing_arena'];
							$location_url = "arena.$phpEx";
							break;
						case PAGE_HOSPITAL:
							$location = $lang['Viewing_hospital'];
							$location_url = "hospital.$phpEx";
							break;
						case PAGE_RPGSHOP:
							$location = $lang['Viewing_rpgshop'];
							$location_url = "rpgshop.$phpEx";
							break;
						case PAGE_RPGHOME:
							$location = $lang['Viewing_rpghome'];
							$location_url = "rpgcp.$phpEx";
							break;
						case PAGE_RPGPROFILE:
							$location = $lang['Viewing_rpgprofile'];
							$location_url = "index.$phpEx";
							break;
						case PAGE_RPGWORLD:
							$location = $lang['Viewing_rpgworld'];
							$location_url = "rpg.$phpEx";
							break;
						case PAGE_RPGSTATS:
							$location = $lang['Viewing_rpgstats'];
							$location_url = "rpgstats.$phpEx";
							break;
						case PAGE_RPGHELP:
							$location = $lang['Viewing_rpghelp'];
							$location_url = "rpghelp.$phpEx";
							break;
						// END RPGPLUS
						
#
#-----[ OPEN ]------------------------------------------
#
admin/admin_forums.php

#
#-----[ FIND ]------------------------------------------
#
include($phpbb_root_path . 'includes/functions_admin.'.$phpEx);

#
#-----[ AFTER, ADD ]------------------------------------------
#

// RPG PLUS
if ( !file_exists(@phpbb_realpath($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_rpg_admin.'.$phpEx)) )
{
	include($phpbb_root_path . 'language/lang_english/lang_rpg_admin.' . $phpEx);
}
else
{
	include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_rpg_admin.' . $phpEx);
}
// END RPGPLUS

#
#-----[ FIND ]------------------------------------------
#

			$statuslist .= "<option value=\"" . FORUM_LOCKED . "\" $forumlocked>" . $lang['Status_locked'] . "</option>\n";

#
#-----[ AFTER, ADD ]------------------------------------------
#

			// RPG PLUS
			if ($row['in_rpg'])
			{
				$rpg_on = "checked='checked'";
			}
			else
			{
				$rpg_off = "checked='checked'";
			}
			
			if ($row['exp_post'])
			{
				$exp_on = "checked='checked'";
			}
			else
			{
				$exp_off = "checked='checked'";
			}
			$forum_battles = $row['forum_battles'];

			// Points MOD
			if ($row['points_disabled'])
			{
				$yes = 'selected="selected"';
			}
			else
			{
				$no = 'selected="selected"';
			}
			$pointslist = '<option value="' . TRUE . '" ' . $yes . '>' . $lang['Yes'] . '</option>';
			$pointslist .= '<option value="' . FALSE . '" ' . $no . '>' . $lang['No'] . '</option>';
			// END RPGPLUS

#
#-----[ FIND ]------------------------------------------
#

				'S_PRUNE_ENABLED' => $prune_enabled,

#
#-----[ AFTER, ADD ]------------------------------------------
#

				// RPG PLUS
				'IN_RPG_ON' => $rpg_on,
				'IN_RPG_OFF' => $rpg_off,
				'EXP_POST_ON' => $exp_on,
				'EXP_POST_OFF' => $exp_off,
				'S_FORUM_BATTLES' => $forum_battles,
				'S_POINTS_LIST' => $pointslist, // Points MOD
				// END RPG PLUS

#
#-----[ FIND ]------------------------------------------
#

				'L_DAYS' => $lang['Days'],

#
#-----[ AFTER, ADD ]------------------------------------------
#

				// RPG PLUS
				'L_IN_RPG' => $lang['Forum_in_rpg'],
				'L_EXP_POST' => $lang['Exp_post'],
				'L_YES' => $lang['Yes'],
				'L_NO' => $lang['No'],
				'L_FORUM_BATTLES' => $lang['Forum_battles'],
				'L_FORUM_BATTLES_EXPLAIN' => $lang['Forum_battles_explain'],
				'L_POINTS_DISABLED' => sprintf($lang['Points_disabled'], $board_config['points_name']), // Points MOD
				// END RPG PLUS

#
#-----[ FIND ]------------------------------------------
#

			$sql = "INSERT INTO " . FORUMS_TABLE . "

#
#-----[ IN-LINE FIND ]------------------------------------------ 
#

prune_enable

#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------ 
#

, exp_post, in_rpg, forum_battles , points_disabled

#
#-----[ FIND ]------------------------------------------
#

				VALUES ('"

#
#-----[ IN-LINE FIND ]------------------------------------------ 
#

intval($HTTP_POST_VARS['prune_enable']) .

#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------ 
#

 ", " . intval($HTTP_POST_VARS['exp_post']) . ", " . intval($HTTP_POST_VARS['in_rpg']) . ", " . intval($HTTP_POST_VARS['forum_battles']) . ", " .  intval($HTTP_POST_VARS['points_disabled']) . 

#
#-----[ FIND ]------------------------------------------
#

				SET forum_name

#
#-----[ IN-LINE FIND ]------------------------------------------ 
#

prune_enable = " . intval($HTTP_POST_VARS['prune_enable']) . "

#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------ 
#

, in_rpg = " . intval($HTTP_POST_VARS['in_rpg']) . ", exp_post = " . intval($HTTP_POST_VARS['exp_post']) . ", forum_battles = " . intval($HTTP_POST_VARS['forum_battles']) . ", points_disabled = " . intval($HTTP_POST_VARS['points_disabled']) . "

#
#-----[ OPEN ]------------------------------------------
#
admin/admin_users.php

#
#-----[ FIND ]------------------------------------------
#

require($phpbb_root_path . 'includes/functions_validate.'.$phpEx);

#
#-----[ AFTER, ADD ]------------------------------------------
#

// RPG PLUS
include($phpbb_root_path . 'includes/functions_rpgstats.'.$phpEx);
if ( !file_exists(@phpbb_realpath($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_rpg_admin.'.$phpEx)) )
{
	include($phpbb_root_path . 'language/lang_english/lang_rpg_admin.' . $phpEx);
}
else
{
	include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_rpg_admin.' . $phpEx);
}
// END RPG PLUS

#
#-----[ FIND ]------------------------------------------
#

else
{
	$mode = '';
}

#
#-----[ AFTER, ADD ]------------------------------------------
#

// RPG PLUS

//
// Generate Image Pickers
//

// Left characters
$dir = @opendir($phpbb_root_path . 'images/rpgplus/lchars');

while($file = @readdir($dir))
{
	if( !@is_dir(phpbb_realpath($phpbb_root_path . 'images/rpgplus/lchars/' . $file)) )
	{
		$img_size = @getimagesize($phpbb_root_path . 'images/rpgplus/lchars/' . $file);

		if( $img_size[0] && $img_size[1] )
		{
			$lchar_images[] = $file;
		}
	}
}

@closedir($dir);

	$l_filename_list = "";
	for( $i = 0; $i < count($lchar_images); $i++ )
	{
		$l_filename_list .= '<option value="' . $lchar_images[$i] . '">' . $lchar_images[$i] . '</option>';
	}
	
// Right characters
$dir = @opendir($phpbb_root_path . 'images/rpgplus/rchars');

while($file = @readdir($dir))
{
	if( !@is_dir(phpbb_realpath($phpbb_root_path . 'images/rpgplus/rchars/' . $file)) )
	{
		$img_size = @getimagesize($phpbb_root_path . 'images/rpgplus/rchars/' . $file);

		if( $img_size[0] && $img_size[1] )
		{
			$rchar_images[] = $file;
		}
	}
}

@closedir($dir);

	$r_filename_list = "";
	for( $i = 0; $i < count($rchar_images); $i++ )
	{
		$r_filename_list .= '<option value="' . $rchar_images[$i] . '">' . $rchar_images[$i] . '</option>';
	}
// END RPG PLUS

#
#-----[ FIND ]------------------------------------------
#

		$password_confirm = ( !empty($HTTP_POST_VARS['password_confirm']) ) ? trim(strip_tags(htmlspecialchars( $HTTP_POST_VARS['password_confirm'] ) )) : '';

#
#-----[ AFTER, ADD ]------------------------------------------
#

		// RPG PLUS
		$rpgname = ( !empty($HTTP_POST_VARS['rpgname']) ) ? trim(strip_tags( $HTTP_POST_VARS['rpgname'] ) ) : '';
		$gender = ( !empty($HTTP_POST_VARS['gender']) ) ? trim(strip_tags( $HTTP_POST_VARS['gender'] ) ) : '';
		$race = ( !empty($HTTP_POST_VARS['race']) ) ? trim(strip_tags( $HTTP_POST_VARS['race'] ) ) : '';
		$job = ( !empty($HTTP_POST_VARS['job']) ) ? trim(strip_tags( $HTTP_POST_VARS['job'] ) ) : '';
		$element = ( !empty($HTTP_POST_VARS['element']) ) ? trim(strip_tags( $HTTP_POST_VARS['element'] ) ) : '';		
		$alignment = ( !empty($HTTP_POST_VARS['alignment']) ) ? trim(strip_tags( $HTTP_POST_VARS['alignment'] ) ) : '';
		$rpg_avatar = ( !empty($HTTP_POST_VARS['rpg_avatar']) ) ? trim(strip_tags( $HTTP_POST_VARS['rpg_avatar'] ) ) : '';
		$rpg_desc = ( !empty($HTTP_POST_VARS['rpg_desc']) ) ? trim(strip_tags( $HTTP_POST_VARS['rpg_desc'] ) ) : '';
		$lchar = ( !empty($HTTP_POST_VARS['lchar']) ) ? trim(strip_tags( $HTTP_POST_VARS['lchar'] ) ) : '';
		$rchar = ( !empty($HTTP_POST_VARS['rchar']) ) ? trim(strip_tags( $HTTP_POST_VARS['rchar'] ) ) : '';
		$special_move = ( !empty($HTTP_POST_VARS['special_move']) ) ? trim(strip_tags( $HTTP_POST_VARS['special_move'] ) ) : '';
		$in_rpg = intval($HTTP_POST_VARS['in_rpg']);
		$max_exp = intval($HTTP_POST_VARS['max_exp']);
		$exp = intval($HTTP_POST_VARS['exp']);
		$hp = intval($HTTP_POST_VARS['hp']);
		$max_hp = intval($HTTP_POST_VARS['max_hp']);
		$mp = intval($HTTP_POST_VARS['mp']);
		$max_mp = intval($HTTP_POST_VARS['max_mp']);
		$pp = intval($HTTP_POST_VARS['pp']);
		$max_pp = intval($HTTP_POST_VARS['max_pp']);
		$lvl = intval($HTTP_POST_VARS['lvl']);
		$atk = intval($HTTP_POST_VARS['atk']);
		$mg_atk = intval($HTTP_POST_VARS['mg_atk']);
		$def = intval($HTTP_POST_VARS['def']);
		$mg_def = intval($HTTP_POST_VARS['mg_def']);
		$bwins = intval($HTTP_POST_VARS['bwins']);
		$bloses = intval($HTTP_POST_VARS['bloses']);
		$limit = intval($HTTP_POST_VARS['limit']);
		$max_items = intval($HTTP_POST_VARS['max_items']);
		$bgmusic = intval($HTTP_POST_VARS['bgmusic']);
		$rand_battles = intval($HTTP_POST_VARS['rand_battles']);
		// Points MOD
		$points = intval($HTTP_POST_VARS['points']);
		$allow_points = ( !empty($HTTP_POST_VARS['allow_points']) ) ? intval( $HTTP_POST_VARS['allow_points'] ) : 0;
		// END RPG PLUS

#
#-----[ FIND ]------------------------------------------
#

			$password_confirm = '';

#
#-----[ AFTER, ADD ]------------------------------------------
#

			// RPG PLUS
			$rpgname = htmlspecialchars(stripslashes($rpgname));
			$gender = htmlspecialchars(stripslashes($gender));
			$race = htmlspecialchars(stripslashes($race));
			$job = htmlspecialchars(stripslashes($job));
			$element = htmlspecialchars(stripslashes($element));	
			$alignment = htmlspecialchars(stripslashes($alignment));
			$rpg_avatar = htmlspecialchars(stripslashes($rpg_avatar));
			$rpg_desc = htmlspecialchars(stripslashes($rpg_desc));
			$lchar = htmlspecialchars(stripslashes($lchar));
			$rchar = htmlspecialchars(stripslashes($rchar));
			$special_move = htmlspecialchars(stripslashes($special_move));
			$in_rpg = intval($in_rpg);
			$exp = intval($exp);
			$max_exp = intval($max_exp);
			$hp = intval($hp);
			$max_hp = intval($max_hp);
			$mp = intval($mp);
			$max_mp = intval($max_mp);
			$pp = intval($pp);
			$max_pp = intval($max_pp);
			$lvl = intval($lvl);
			$atk = intval($atk);
			$mg_atk = intval($mg_atk);
			$def = intval($def);
			$mg_def = intval($mg_def);
			$bwins = intval($bwins);
			$bloses = intval($bloses);
			$limit = intval($limit);
			$max_items = intval($max_items);
			$bgmusic = intval($bgmusic);
			$rand_battles = intval($rand_battles);
			$points = intval($points); // Points MOD
			// END RPG PLUS

#
#-----[ FIND ]------------------------------------------
#

		//
		// Update entry in DB
		//
		if( !$error )
		{
			$sql = "UPDATE " . USERS_TABLE . "
				SET 

#
#-----[ IN-LINE FIND ]------------------------------------------ 
#

user_rank = $user_rank

#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------ 
#

,user_in_rpg = '$in_rpg', user_rpgname = '" . str_replace("\'", "''", $rpgname) . "', user_gender = '" . str_replace("\'", "''", $gender) . "', user_race = '" . str_replace("\'", "''", $race) . "',  user_job = '" . str_replace("\'", "''", $job) . "',  user_element = '" . str_replace("\'", "''", $element) . "',  user_alignment = '" . str_replace("\'", "''", $alignment) . "', user_exp = '$exp', user_hp = '$hp', user_max_hp = '$max_hp', user_mp = '$mp', user_max_mp = '$max_mp', user_pp = '$pp', user_max_pp = '$max_pp', user_lvl = '$lvl', user_atk = '$atk', user_def = '$def', user_mgatk = '$mgatk', user_mgdef = '$mgdef', user_rpg_avatar = '" . str_replace("\'", "''", $rpg_avatar) . "', user_rpg_desc = '" . str_replace("\'", "''", $rpg_desc) . "', user_max_items = '$max_items', user_lchar = '" . str_replace("\'", "''", $lchar) . "', user_rchar = '" . str_replace("\'", "''", $rchar) . "', user_bgmusic = '$bgmusic', user_limit = '$limit', user_special_move = '" . str_replace("\'", "''", $special_move) . "', user_bwins = '$bwins', user_bloses = '$bloses', user_rand_battles = '$rand_battles', user_points = $points, admin_allow_points = $allow_points

#
#-----[ FIND ]------------------------------------------
#

			$password_confirm = '';

#
#-----[ AFTER, ADD ]------------------------------------------
#

			// RPG PLUS
			$rpgname = htmlspecialchars(stripslashes($rpgname));
			$gender = htmlspecialchars(stripslashes($gender));
			$race = htmlspecialchars(stripslashes($race));
			$job = htmlspecialchars(stripslashes($job));
			$element = htmlspecialchars(stripslashes($element));	
			$alignment = htmlspecialchars(stripslashes($alignment));
			$rpg_avatar = htmlspecialchars(stripslashes($rpg_avatar));
			$rpg_desc = htmlspecialchars(stripslashes($rpg_desc));
			$lchar = htmlspecialchars(stripslashes($lchar));
			$rchar = htmlspecialchars(stripslashes($rchar));
			$special_move = htmlspecialchars(stripslashes($special_move));
			$exp = intval($exp);
			$max_exp = intval($max_exp);
			$hp = intval($hp);
			$max_hp = intval($max_hp);
			$mp = intval($mp);
			$max_mp = intval($max_mp);
			$pp = intval($pp);
			$max_pp = intval($max_pp);
			$lvl = intval($lvl);
			$atk = intval($atk);
			$mg_atk = intval($mg_atk);
			$def = intval($def);
			$mg_def = intval($mg_def);
			$bwins = intval($bwins);
			$bloses = intval($bloses);
			$limit = intval($limit);
			$max_items = intval($max_items);
			$bgmusic = intval($bgmusic);
			$rand_battles = intval($rand_battles);
			$points = intval($points); // Points MOD
			// END RPG PLUS

#
#-----[ FIND ]------------------------------------------
#

		$password_confirm = '';

#
#-----[ AFTER, ADD ]------------------------------------------
#

		// BEGIN RPG PLUS
		$rpgname = $this_userdata['user_rpgname'];
		$in_rpg = $this_userdata['user_in_rpg'];
		$gender = $this_userdata['user_gender'];
		$race = $this_userdata['user_race'];
		$job = $this_userdata['user_job'];
		$element = $this_userdata['user_element'];		
		$alignment = $this_userdata['user_alignment'];
		$exp = $this_userdata['user_exp'];
		$max_exp = $this_userdata['user_max_exp'];
		$hp = $this_userdata['user_hp'];
		$max_hp = $this_userdata['user_max_hp'];
		$mp = $this_userdata['user_mp'];
		$max_mp = $this_userdata['user_max_mp'];
		$pp = $this_userdata['user_pp'];
		$max_pp = $this_userdata['user_max_pp'];
		$lvl = $this_userdata['user_lvl'];
		$atk = $this_userdata['user_atk'];
		$mg_atk = $this_userdata['user_mgatk'];
		$def = $this_userdata['user_def'];
		$mg_def = $this_userdata['user_mgdef'];
		$rpg_avatar = $this_userdata['user_rpg_avatar'];
		$rpg_desc = $this_userdata['user_rpg_desc'];
		$lchar = $this_userdata['user_lchar'];
		$rchar = $this_userdata['user_rchar'];
		$special_move = $this_userdata['user_special_move'];
		$bwins = $this_userdata['user_bwins'];
		$bloses = $this_userdata['user_bloses'];
		$limit = $this_userdata['user_limit'];
		$max_items = $this_userdata['user_max_items'];
		$bgmusic = $this_userdata['user_bgmusic'];
		$rand_battles = $this_userdata['user_rand_battles'];
		// Points MOD
		$points = $this_userdata['user_points'];
		$allow_points = $this_userdata['admin_allow_points'];

		if ($in_rpg)
		{
			$rpg_on = "checked='checked'";
		}
		else
		{
			$rpg_off = "checked='checked'";
		}

		if ($gender == 'Male')
		{
			$male = "checked='checked'";
		}
		elseif($gender == 'Female')
		{
			$female = "checked='checked'";
		}
		else
		{
			$undecided = "checked='checked'";
		}
	
		if ($alignment == 'Good')
		{
			$good = "checked='checked'";
		}
		elseif($alignment == 'Evil')
		{
			$evil = "checked='checked'";
		}
		else
		{
			$neutral = "checked='checked'";
		}
		if($bgmusic)
		{
			$bgmusic_on = "checked='checked'";
		}
		else
		{
			$bgmusic_off = "checked='checked'";
		}
		if($rand_battles)
		{
			$rand_battles_on = "checked='checked'";
		}
		else
		{
			$rand_battles_off = "checked='checked'";
		}
		// END RPG PLUS

#
#-----[ FIND ]------------------------------------------
#

			$s_hidden_fields .= '<input type="hidden" name="user_rank" value="' . $user_rank . '" />';

#
#-----[ AFTER, ADD ]------------------------------------------
#

			// RPG PLUS
			$s_hidden_fields .= '<input type="hidden" name="rpgname" value="' . $rpgname . '" />';
			$s_hidden_fields .= '<input type="hidden" name="gender" value="' . $gender . '" />';
			$s_hidden_fields .= '<input type="hidden" name="race" value="' . $race . '" />';
			$s_hidden_fields .= '<input type="hidden" name="job" value="' . $job . '" />';
			$s_hidden_fields .= '<input type="hidden" name="element" value="' . $element . '" />';
			$s_hidden_fields .= '<input type="hidden" name="alignment" value="' . $alignment . '" />';
			$s_hidden_fields .= '<input type="hidden" name="exp" value="' . $exp . '" />';
			$s_hidden_fields .= '<input type="hidden" name="max_exp" value="' . $max_exp . '" />';
			$s_hidden_fields .= '<input type="hidden" name="hp" value="' . $hp . '" />';
			$s_hidden_fields .= '<input type="hidden" name="max_hp" value="' . $max_hp . '" />';
			$s_hidden_fields .= '<input type="hidden" name="mp" value="' . $mp . '" />';
			$s_hidden_fields .= '<input type="hidden" name="max_mp" value="' . $max_mp . '" />';
			$s_hidden_fields .= '<input type="hidden" name="pp" value="' . $pp . '" />';
			$s_hidden_fields .= '<input type="hidden" name="max_pp" value="' . $max_pp . '" />';
			$s_hidden_fields .= '<input type="hidden" name="atk" value="' . $atk . '" />';
			$s_hidden_fields .= '<input type="hidden" name="mg_atk" value="' . $mg_atk . '" />';
			$s_hidden_fields .= '<input type="hidden" name="def" value="' . $def . '" />';
			$s_hidden_fields .= '<input type="hidden" name="mg_def" value="' . $mg_def . '" />';
			$s_hidden_fields .= '<input type="hidden" name="lvl" value="' . $lvl . '" />';
			$s_hidden_fields .= '<input type="hidden" name="rpg_avatar" value="' . $rpg_avatar . '" />';
			$s_hidden_fields .= '<input type="hidden" name="rpg_desc" value="' . $rpg_desc . '" />';
			$s_hidden_fields .= '<input type="hidden" name="max_items" value="' . $max_items . '" />';
			$s_hidden_fields .= '<input type="hidden" name="lchar" value="' . $lchar . '" />';
			$s_hidden_fields .= '<input type="hidden" name="rchar" value="' . $rchar . '" />';
			$s_hidden_fields .= '<input type="hidden" name="bgmusic" value="' . $bgmusic . '" />';
			$s_hidden_fields .= '<input type="hidden" name="limit" value="' . $limit . '" />';
			$s_hidden_fields .= '<input type="hidden" name="special_move" value="' . $special_move . '" />';
			$s_hidden_fields .= '<input type="hidden" name="bloses" value="' . $bloses . '" />';
			$s_hidden_fields .= '<input type="hidden" name="bwins" value="' . $bwins . '" />';
			$s_hidden_fields .= '<input type="hidden" name="rand_battles" value="' . $rand_battles . '" />';
			// Points MOD
			$s_hidden_fields .= '<input type="hidden" name="points" value="' . $points . '" />';
			$s_hidden_fields .= '<input type="hidden" name="allow_points" value="' . $allow_points . '" />';
			// END RPG PLUS

#
#-----[ FIND ]------------------------------------------
#

			'RANK_SELECT_BOX' => $rank_select_box,

#
#-----[ AFTER, ADD ]------------------------------------------
#

			// RPG PLUS
			'RPGNAME' => $rpgname,	
			'RPG_ON' => $rpg_on,
			'RPG_OFF' => $rpg_off,
			'RACE_SELECT' => rpg_select('name', 'name', RACE_TABLE, 'rpgrace', $race),
			'JOB_SELECT' => rpg_select('name', 'name', JOB_TABLE, 'rpgjob', $job, '', "WHERE '$lvl' >= lvl_need AND gender = '$gender'"),
			'ELEMENT_SELECT' => rpg_select('name', 'name', ELEMENT_TABLE, 'rpgelement', $element),
			'MALE' => $male,
			'FEMALE' => $female,
			'UNDECIDED' => $undecided,
			'GOOD' => $good,
			'EVIL' => $evil,
			'NEUTRAL' => $neutral,
			'EXP' => $exp,
			'MAX_EXP' => $max_exp,
			'HP' => $hp,
			'MAX_HP' => $max_hp,
			'MP' => $mp,
			'MAX_MP' => $max_mp,	
			'PP' => $pp,
			'MAX_PP' => $max_pp,
			'ATK' => $atk,
			'MG_ATK' => $mg_atk,
			'DEF' => $def,
			'MG_DEF' => $mg_def,
			'LVL' => $lvl,
			'RPG_AVATAR' => $rpg_avatar,	
			'RPG_DESC' => $rpg_desc,
			'MAX_ITEMS' => $max_items,
			'LCHAR' => $lchar,
			'RCHAR' => $rchar,
			'BGMUSIC_ON' => $bgmusic_on,
			'BGMUSIC_OFF' => $bgmusic_off,
			'LIMIT' => $limit,
			'SPECIAL_MOVE' => $special_move,
			'BLOSES' => $bloses,
			'BWINS' => $bwins,
			'RAND_BATTLES_ON' => $rand_battles_on,
			'RAND_BATTLES_OFF' => $rand_battles_off,
			'RAND_BATTLES' => $rand_battles,
			"CURRENT_L_IMAGE" => $lchar,
			"S_L_FILENAME_OPTIONS" => $l_filename_list,
			"LCHAR_IMG" => $phpbb_root_path . 'images/rpgplus/lchars/' . $lchar,
			"S_LCHAR_BASEDIR" => $phpbb_root_path . 'images/rpgplus/lchars',
			"CURRENT_R_IMAGE" => $rchar,
			"S_R_FILENAME_OPTIONS" => $r_filename_list,
			"RCHAR_IMG" => $phpbb_root_path . 'images/rpgplus/rchars/' . $rchar,
			"S_RCHAR_BASEDIR" => $phpbb_root_path . 'images/rpgplus/rchars',
			// Points MOD
			'POINTS' => $points,
			'ALLOW_POINTS_YES' => ($allow_points) ? 'checked="checked"' : '',
			'ALLOW_POINTS_NO' => (!$allow_points) ? 'checked="checked"' : '', 
			// END RPG PLUS

#
#-----[ FIND ]------------------------------------------
#

			'L_ALWAYS_ADD_SIGNATURE' => $lang['Always_add_sig'],

#
#-----[ AFTER, ADD ]------------------------------------------
#

			// RPG PLUS
			'L_RPG_INFO' => $lang['Rpg_info'],
			'L_IN_RPG' => $lang['In_rpg'],
			'L_RPG_INFO_EXPLAIN' => $lang['Rpg_info_explain'],
			'L_RPGNAME' => $lang['User_rpgname'],
			'L_GENDER' => $lang['User_gender'],
			'L_MALE' => $lang['Rpg_male'],	
			'L_FEMALE' => $lang['Rpg_female'],	
			'L_UNDECIDED' => $lang['Rpg_undecided'],	
			'L_GOOD' => $lang['Rpg_good'],	
			'L_EVIL' => $lang['Rpg_evil'],	
			'L_NEUTRAL' => $lang['Rpg_neutral'],
			'L_RACE' => $lang['User_race'],
			'L_JOB' => $lang['User_job'],
			'L_ELEMENT' => $lang['User_element'],
			'L_ALIGNMENT' => $lang['User_alignment'],
			'L_EXP' => $lang['User_exp'],
			'L_MAX_EXP' => $lang['User_max_exp'],
			'L_HP' => $lang['User_hp'],
			'L_MAX_HP' => $lang['User_max_hp'],
			'L_MP' => $lang['User_mp'],
			'L_MAX_MP' => $lang['User_max_mp'],
			'L_PP' => $lang['User_pp'],
			'L_MAX_PP' => $lang['User_max_pp'],
			'L_ATK' => $lang['User_atk'],
			'L_MG_ATK' => $lang['User_mg_atk'],
			'L_DEF' => $lang['User_def'],
			'L_MG_DEF' => $lang['User_mg_def'],
			'L_LVL' => $lang['User_lvl'],
			'L_BWINS' => $lang['Battle_wins'],
			'L_BLOSES' => $lang['Battle_loses'],
			'L_BGMUSIC' => $lang['Background_music'],
			'L_RPG_AVATAR' => $lang['Rpg_avatar'],
			'L_RPG_CHARACTER' => $lang['Rpg_character'],
			'L_CHARACTER_EXPLAIN' => $lang['Rpg_character_explain'],
			'L_LCHAR_EDIT' => $lang['Lchar'],
			'L_RCHAR_EDIT' => $lang['Rchar'],
			'L_SPECIAL_MOVE' => $lang['Special_move'],
			'L_LIMIT' => $lang['Limit'],
			'L_MAX_ITEMS' => $lang['Max_items'],
			'L_RAND_BATTLES' => $lang['Rand_battles'],
			// Points MOD
			'L_POINTS' => $board_config['points_name'],
			'L_ALLOW_POINTS' => $lang['Allow_Points'],
			// END RPG PLUS

#
#-----[ OPEN ]------------------------------------------
#
includes/constants.php

#
#-----[ FIND ]------------------------------------------
#

define('PAGE_GROUPCP', -11);

#
#-----[ AFTER, ADD ]------------------------------------------
#

// RPGPLUS
define('PAGE_ARENA', 550); // random number for no mod conflicts (hopefully)
define('PAGE_HOSPITAL', 551);
define('PAGE_RPGSHOP', 552);
define('PAGE_RPGPROFILE', 553);
define('PAGE_RPGHOME', 554);
define('PAGE_RPGWORLD', 555);
define('PAGE_RPGSTATS', 556);
define('PAGE_RPGHELP', 557);
// RPGPLUS

#
#-----[ FIND ]------------------------------------------
#

define('VOTE_USERS_TABLE', $table_prefix.'vote_voters');

#
#-----[ AFTER, ADD ]------------------------------------------
#

// RPG TABLES
define('RACE_TABLE', $table_prefix.'rpg_race');
define('JOB_TABLE', $table_prefix.'rpg_job');
define('ELEMENT_TABLE', $table_prefix.'rpg_element');
define('RPGSHOP_TABLE', $table_prefix.'rpg_shop_config');
define('RPGITEMS_TABLE', $table_prefix.'rpg_shop_items');
define('USERITEMS_TABLE', $table_prefix.'rpg_user_items');
define('AREA_TABLE', $table_prefix.'rpg_area');
define('BATTLE_TABLE', $table_prefix.'rpg_battles');
define('AI_TABLE', $table_prefix.'rpg_ai');
define('BATTLE_AI_TABLE', $table_prefix.'rpg_battle_ai');
define('AI_ATTACKS_TABLE', $table_prefix.'rpg_ai_attacks');
define('TAUNT_TABLE', $table_prefix.'rpg_battle_taunts');
define('BATTLE_LOG_TABLE', $table_prefix.'rpg_battle_logs');
define('RPGHELP_TABLE', $table_prefix.'rpg_help');
// END RPG TABLES

#
#-----[ OPEN ]------------------------------------------
#
includes/functions.php

#
#-----[ FIND ]------------------------------------------
#

			$sql = "SELECT SUM(forum_topics) AS topic_total, SUM(forum_posts) AS post_total
				FROM " . FORUMS_TABLE;
			break;
#
#-----[ AFTER, ADD ]------------------------------------------
#

		// RPG PLUS
		case 'rpgmembers':
			$sql = "SELECT COUNT(user_id) AS total
				FROM " . USERS_TABLE . "
					WHERE user_in_rpg = 1
					AND user_id <> -1";
			break;
		case 'rpgjobs':
			$sql = "SELECT COUNT(id) AS total
				FROM " . JOB_TABLE;
			break;
		case 'rpgraces':
			$sql = "SELECT COUNT(name) AS total
				FROM " . RACE_TABLE;
			break;
		case 'rpgmonsters':
			$sql = "SELECT COUNT(ai_id) AS total
				FROM " . AI_TABLE;
			break;
		// RPG PLUS

#
#-----[ FIND ]------------------------------------------
#

		case 'usercount':
		
#
#-----[ AFTER, ADD ]------------------------------------------
#

		//RPGPLUS
		case 'rpgmembers':
		case 'rpgjobs':
		case 'rpgraces':
		case 'rpgmonsters':
		//END RPGPLUS
	
#
#-----[ FIND ]------------------------------------------
#

	include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.' . $phpEx);

#
#-----[ AFTER, ADD ]------------------------------------------
#

	// RPG PLUS
	if ( (!file_exists(@phpbb_realpath($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_rpg_stats.'.$phpEx))) && ($userdata['user_in_rpg']))
	{
		include($phpbb_root_path . 'language/lang_english/lang_rpg_stats.' . $phpEx);
	}
	else
	{
		include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_rpg_stats.' . $phpEx);
	}
	// END RPG PLUS
	
#
#-----[ OPEN ]------------------------------------------
#
includes/functions_post.php

#
#-----[ FIND ]------------------------------------------
#

	global $userdata, $user_ip;

#
#-----[ IN-LINE FIND ]------------------------------------------ 
#

$user_ip

#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------ 
#

, $post_info

#
#-----[ FIND ]------------------------------------------
#

	$meta = '<meta http-equiv="refresh" content="3;url=' . append_sid("viewtopic.$phpEx?" . POST_POST_URL . "=" . $post_id) . '#' . $post_id . '">';

#
#-----[ BEFORE, ADD ]------------------------------------------
#

	// RPG PLUS - EXP ON POSTING
	if (($post_info['in_rpg'] == 1) && ($post_info['exp_post'] == 1) && ($board_config['exp_on_post'] == 'on') && ($userdata['user_in_rpg'])&& (($mode == 'newtopic') || ($mode == 'reply')))
	{
		if ($userdata['user_id'] != ANONYMOUS)
		{
			$exp_gained = $board_config['exp_gain'];
			$levelup = add_exp($userdata['user_id'], $exp_gained);// Also get level up message
		}
	}
	// Points MOD
	if ($board_config['points_post'] && !$post_info['points_disabled'] && (($mode == 'newtopic') || ($mode == 'reply')) )
	{
		$points = abs(($mode == 'newtopic') ? $board_config['points_topic'] : $board_config['points_reply']);

		if (($userdata['user_id'] != ANONYMOUS) && ($userdata['admin_allow_points']))
		{
			add_points($userdata['user_id'], $points);
		}
	}
	// END RPG PLUS

#
#-----[ FIND ]------------------------------------------
#

	$message = $lang['Stored']

#
#-----[ IN-LINE FIND ]------------------------------------------ 
#

$message =

#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------ 
#

$levelup .

#
#-----[ FIND ]------------------------------------------
#

$message .=  '<br /><br />' . sprintf($lang['Click_return_forum'], '<a href="' . append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id") . '">', '</a>');

#
#-----[ BEFORE, ADD ]------------------------------------------
#

	// RPG PLUS - EXP MINUS ON DELETING
	if (($userdata['user_id'] != ANONYMOUS) && ($userdata['user_in_rpg']))
	{
		$exp_gained = $board_config['exp_gain'];
		add_exp($userdata['user_id'], -$exp_gained);// Add a minus value
	}
	// Points MOD
	if ($board_config['points_post'] && !$post_info['points_disabled'] && ($mode == 'delete' || $mode == 'poll_delete') )
	{
		if (($userdata['user_id'] == $post_data['first_post']) && (($userdata['user_id'] != ANONYMOUS) && ($userdata['admin_allow_points'])))
		{
			subtract_points($userdata['user_id'], $board_config['points_topic']);
		}
		else if (($userdata['user_id'] != ANONYMOUS) && ($userdata['admin_allow_points']))
		{
			subtract_points($userdata['user_id'], $board_config['points_reply']);
		}
	}
	// END RPG PLUS

#
#-----[ OPEN ]------------------------------------------
#
includes/page_header.php

#
#-----[ FIND ]------------------------------------------
#

if ( $userdata['session_logged_in'] )
{
	$u_login_logout = 'login.'.$phpEx.'?logout=true&amp;sid=' . $userdata['session_id'];
	$l_login_logout = $lang['Logout'] . ' [ ' . $userdata['username'] . ' ]';

#
#-----[ AFTER, ADD ]------------------------------------------
#

	if ($board_config['points_browse'] && !$post_info['points_disabled'] )
	{
		$points = $board_config['points_browse'];

		if (($userdata['user_id'] !=ANONYMOUS) && ($userdata['admin_allow_points']))
		{
			add_points($userdata['user_id'], $points);
		}
	}

#
#-----[ FIND ]------------------------------------------
#

	'U_FAQ' => append_sid('faq.'.$phpEx),

#
#-----[ AFTER, ADD ]------------------------------------------
#

	// RPG PLUS
	'RPGWORLD' => $board_config['rpgworld'],
	'U_RPGWORLD' => append_sid('rpg.'.$phpEx),
	// END RPG PLUS

#
#-----[ FIND ]------------------------------------------
#

	if ( !empty($userdata['user_popup_pm']) )
	{
		$template->assign_block_vars('switch_enable_pm_popup', array());
	}

#
#-----[ AFTER, ADD ]------------------------------------------
#

	// RPG PLUS
	if ($userdata['user_in_rpg'])
	{
		$template->assign_block_vars('rpg_links', array());
	}
	// END RPG PLUS

#
#-----[ OPEN ]------------------------------------------
#
includes/usercp_register.php

#
#-----[ FIND ]------------------------------------------
#

	$notifypm = ( isset($HTTP_POST_VARS['notifypm']) ) ? ( ($HTTP_POST_VARS['notifypm']) ? TRUE : 0 ) : TRUE;

#
#-----[ AFTER, ADD ]------------------------------------------
#

	$in_rpg = ( isset($HTTP_POST_VARS['in_rpg']) ) ? ( ($HTTP_POST_VARS['in_rpg']) ? TRUE : 0 ) : TRUE;
	$notifydonation = ( isset($HTTP_POST_VARS['notifydonation']) ) ? ( ($HTTP_POST_VARS['notifydonation']) ? TRUE : 0 ) : TRUE; // Points MOD

#
#-----[ FIND ]------------------------------------------
#

			$sql = "UPDATE " . USERS_TABLE . "
				SET

#
#-----[ IN-LINE FIND ]------------------------------------------ 
#

user_active = $user_active

#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------ 
#

, user_in_rpg = $in_rpg, user_notify_donation = $notifydonation

#
#-----[ FIND ]------------------------------------------
#

			$user_id = $row['total'] + 1;

#
#-----[ AFTER, ADD ]------------------------------------------
#

			// Rpgplus
			$hp = $board_config['default_hp'];
			$mp = $board_config['default_mp'];
			$pp = $board_config['default_pp'];
			$atk = $board_config['default_atk'];
			$mgatk = $board_config['default_mgatk'];
			$def = $board_config['default_def'];
			$mgdef = $board_config['default_mgdef'];
			// END Rpgplus
	
#
#-----[ FIND ]------------------------------------------
#

			//
			// Get current date
			//
			$sql = "INSERT INTO " . USERS_TABLE . "

#
#-----[ IN-LINE FIND ]------------------------------------------ 
#

, user_style

#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------ 
#

, user_in_rpg, user_rpgname, user_hp, user_max_hp, user_mp, user_max_mp, user_pp, user_max_pp, user_atk, user_mgatk, user_def, user_mgdef, user_notify_donation

#
#-----[ FIND ]------------------------------------------
#

VALUES (

#
#-----[ IN-LINE FIND ]------------------------------------------ 
#

$user_style,

#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------ 
#

'" . intval($HTTP_POST_VARS['in_rpg']) . "', '" . str_replace("\'", "''", $username) . "', $hp, $hp, $mp, $mp, $pp, $pp, $atk, $mgatk, $def, $mgdef, $notifydonation,

#
#-----[ FIND ]------------------------------------------
#

				$db->sql_freeresult($result);
			}

#
#-----[ AFTER, ADD ]------------------------------------------
#

			// RPGPLUS
			if(intval($HTTP_POST_VARS['in_rpg']) == 1)
			{
				$message = $message . '<br /><br />' . sprintf($lang['Click_goto_rpgcp'],  '<a href="' . append_sid("rpgcp.$phpEx") . '">', '</a>');
			}
			// END RPGPLUS

#
#-----[ FIND ]------------------------------------------
#

	$notifyreply = $userdata['user_notify'];

#
#-----[ AFTER, ADD ]------------------------------------------
#

	$in_rpg = $userdata['user_in_rpg'];
	$notifydonation = $userdata['user_notify_donation']; // Points MOD
			
#
#-----[ FIND ]------------------------------------------
#

	else
	{
		$template->assign_block_vars('switch_namechange_disallowed', array());
	}

#
#-----[ AFTER, ADD ]------------------------------------------
#

	// RPG PLUS
	if ($in_rpg)
	{
		$rpg_on = "checked='checked'";
	}
	else
	{
		$rpg_off = "checked='checked'";
	}
	// END RPG PLUS

#
#-----[ FIND ]------------------------------------------
#

		'EMAIL' => $email,

#
#-----[ AFTER, ADD ]------------------------------------------
#

		// RPG PLUS
		'RPG_ON' => $rpg_on,
		'RPG_OFF' => $rpg_off,
		// Points MOD
		'NOTIFY_DONATION_YES' => ( $notifydonation ) ? 'checked="checked"' : '',
		'NOTIFY_DONATION_NO' => ( !$notifydonation ) ? 'checked="checked"' : '',
		// END RPG PLUS

#
#-----[ FIND ]------------------------------------------
#

		'L_RESET' => $lang['Reset'],

#
#-----[ AFTER, ADD ]------------------------------------------
#

		// RPG PLUS
		'L_IN_RPG' => $lang['In_rpg'],
		// Points MOD
		'L_NOTIFY_DONATION' => sprintf($lang['Points_notify'], $board_config['points_name']),
		'L_NOTIFY_DONATION_EXPLAIN' => sprintf($lang['Points_notify_explain'], $board_config['points_name']),
		// END RPG PLUS

#
#-----[ OPEN ]------------------------------------------
#
includes/usercp_viewprofile.php

#
#-----[ FIND ]------------------------------------------
#

$search = '<a href="' . $temp_url . '">' . $lang['Search_user_posts'] . '</a>';

#
#-----[ AFTER, ADD ]------------------------------------------
#

// RPG PLUS
if (($board_config['rpgprofile_on_profile'] == "on") && ($userdata['user_in_rpg']))
{
	$template->assign_block_vars('rpgprofile', array());
}
$where_id = intval($HTTP_GET_VARS['u']);
$temp_url = append_sid($phpbb_root_path . "rpgcp.$phpEx?mode=view&amp;where=profile&amp;where_id=$where_id&amp;id=$where_id");
$rpg_profile_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_rpg_profile'] . '" alt="" title="" border="0" /></a>';
// Points MOD
$user_points = ($userdata['user_level'] == ADMIN || user_is_authed($userdata['user_id'])) ? '<a href="' . append_sid("pointscp.$phpEx?" . POST_USERS_URL . "=" . $profiledata['user_id']) . '" class="gen" title="' . sprintf($lang['Points_link_title'], $board_config['points_name']) . '">' . $profiledata['user_points'] . '</a>' : $profiledata['user_points'];
if ($board_config['points_donate'] && $userdata['user_id'] != ANONYMOUS && $userdata['user_id'] != $profiledata['user_id'])
{
	$donate_points = '<br />' . sprintf($lang['Points_donate'], '<a href="' . append_sid("pointscp.$phpEx?mode=donate&amp;" . POST_USERS_URL . "=" . $profiledata['user_id']) . '" class="genmed" title="' . sprintf($lang['Points_link_title_2'], $board_config['points_name']) . '">', '</a>');
}
else
{
	$donate_points = '';
}
// END RPG PLUS

#
#-----[ FIND ]------------------------------------------
#

	'YIM' => $yim,

#
#-----[ AFTER, ADD ]------------------------------------------
#

	// RPG PLUS
	'RPG_PROFILE' => $rpg_profile_img,
	// Points MOD
	'POINTS' => $user_points,
	'DONATE_POINTS' => $donate_points,
	// END RPG PLUS
	
#
#-----[ FIND ]------------------------------------------
#

	'L_INTERESTS' => $lang['Interests'],

#
#-----[ AFTER, ADD ]------------------------------------------
#

	// RPG PLUS
	'L_RPG_PROFILE' => $lang['Rpg_info'],
	'L_POINTS' => $board_config['points_name'], // Points MOD
	// END RPG PLUS

#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_admin.php

#
#-----[ FIND ]------------------------------------------
#

//
// That's all Folks!
// -------------------------------------------------

#
#-----[ BEFORE, ADD ]------------------------------------------
#

// Points System MOD - Admin
$lang['Points_updated']	= 'Points Configuration Updated Successfully';
$lang['Click_return_points'] = 'Click %sHere%s to return to Points Configuration';
$lang['Points_config_explian'] = 'The form below will allow you to edit your point system configuration.';
$lang['Points_sys_settings'] = 'Points System Settings';
$lang['Points_disabled'] = 'Disable %s';
$lang['Points_enable_post']	= 'Earn %s by posting';
$lang['Points_enable_donation']	= 'Enable Donation';
$lang['Points_name'] = 'Points Name';
$lang['Points_per_reply'] = 'Points Per Reply';
$lang['Points_per_topic'] = 'Points Per New Topic';
$lang['Points_user_group_auth'] = 'Authorized Groups';
$lang['Points_enable_post_explain']	= 'Let users earn %s by posting new topics and replies';
$lang['Points_enable_donation_explain']	= 'Let users donate %s to their friends';
$lang['Points_name_explain'] = 'Whatever you call your points on your board e.g. (money, gil, gold)';
$lang['Points_per_reply_explain'] = 'The amount of %s they earn per reply';
$lang['Points_per_topic_explain'] = 'The amount of %s they earn per new topic';
$lang['Points_user_group_auth_explain'] = 'Enter ids of groups who are authorized to access the points control panel, one id per line.';
$lang['Allow_Points'] = 'Use the Points System?';
$lang['Points_reset'] = 'Reset everyones Points';
$lang['Points_reset_explain'] = 'Input a number and submit. Everyones Points will become the number you entered.';

#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/admin/forum_edit_body.tpl

#
#-----[ FIND ]------------------------------------------
#

	<tr> 
	  <td class="row1">{L_FORUM_STATUS}</td>
	  <td class="row2"><select name="forumstatus">{S_STATUS_LIST}</select></td>
	</tr>

#
#-----[ AFTER, ADD ]------------------------------------------
#

	<!-- RPG PLUS -->
	<tr> 
	  <td class="row1">{L_IN_RPG}</td>
	  <td class="row2"><span class="gensmall">
	  	<input type="radio" name="in_rpg" value="1" {IN_RPG_ON} />
		<span class="gen">{L_YES}</span>&nbsp;&nbsp; 
		<input type="radio" name="in_rpg" value="0" {IN_RPG_OFF} />
		<span class="gen">{L_NO}</span></td>
	  </span></td>
	</tr>
	<tr> 
	  <td class="row1">{L_EXP_POST}</td>
	  <td class="row2"><span class="gensmall">
	  	<input type="radio" name="exp_post" value="1" {EXP_POST_ON} />
		<span class="gen">{L_YES}</span>&nbsp;&nbsp; 
		<input type="radio" name="exp_post" value="0" {EXP_POST_OFF} />
		<span class="gen">{L_NO}</span></td>
	  </span></td>
	</tr>
	<tr> 
	  <td class="row1">{L_FORUM_BATTLES}<br /> <span class="gensmall">{L_FORUM_BATTLES_EXPLAIN}</span></td>
	  <td class="row2"><input type="text" size="5" name="forum_battles" value="{S_FORUM_BATTLES}" class="post" /></td>
	</tr>
	<!-- POINTS MOD -->
	<tr> 
	  <td class="row1">{L_POINTS_DISABLED}</td>
	  <td class="row2"><select name="points_disabled">{S_POINTS_LIST}</select></td>
	</tr>
	<!-- ENDING RPG PLUS -->

#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/admin/user_edit_body.tpl

#
#-----[ FIND ]------------------------------------------
#

<h1>{L_USER_TITLE}</h1>

#
#-----[ AFTER, ADD ]------------------------------------------
#

<!-- RPG PLUS -->
<script language="javascript" type="text/javascript">
<!--
function update_lchar(newimage)
{
	document.lchar.src = "{S_LCHAR_BASEDIR}/" + newimage;
}

function update_rchar(newimage)
{
	document.rchar.src = "{S_RCHAR_BASEDIR}/" + newimage;
}
//-->
</script>
<!-- ENDING RPG PLUS -->

#
#-----[ FIND ]------------------------------------------
#

	<tr> 
	  <td class="catsides" colspan="2">&nbsp;</td>
	</tr>

#
#-----[ AFTER, ADD ]------------------------------------------
#

	<!-- RPG PLUS -->
	<tr> 
	  <th class="thSides" colspan="2">{L_RPG_INFO}</th>
	</tr>
	<tr> 
	  <td class="row2" colspan="2"><span class="gensmall">{L_RPG_INFO_EXPLAIN}</span></td>
	</tr>
	<tr> 
	  <td class="row1"><span class="gen">{L_IN_RPG}</span></td>
	  <td class="row2"><span class="gensmall">
	  	<input type="radio" name="in_rpg" value="1" {RPG_ON} />
		<span class="gen">{L_YES}</span>&nbsp;&nbsp; 
		<input type="radio" name="in_rpg" value="0" {RPG_OFF} />
		<span class="gen">{L_NO}</span></td>
	  </span></td>
	</tr>
	<tr> 
	  <td class="row1"><span class="gen">{L_RPGNAME}</span></td>
	  <td class="row2"> 
		<input class="post" type="text" name="rpgname" size="10" maxlength="15" value="{RPGNAME}" />
	  </td>
	</tr>
	<tr> 
	  <td class="row1" width="35%"><span class="gen">{L_RPG_AVATAR}:</span></td>
	  <td class="row2"> 
		<input type="text" name="rpg_avatar" class="post" style="width: 200px"  size="10" value="{RPG_AVATAR}" />
	  </td>
	</tr>
	<tr> 
	  <td valign="top" class="row1"><span class="gen">{L_RPG_CHARACTER}:</span><br /><span class="gensmall">{L_CHARACTER_EXPLAIN}<br /></span></td>
	  <td class="row2"> 
		<textarea name="rpg_desc" style="width: 300px"  rows="6" cols="30" class="post">{RPG_DESC}</textarea>
	  </td>
	</tr>
	<tr> 
	  <td class="row1"><span class="gen">{L_GENDER}:</span></td>
	  <td class="row2"><span class="gensmall">
	  	<input type="radio" name="gender" value="Female" {FEMALE} />
		<span class="gen">{L_FEMALE}</span>&nbsp;&nbsp; 
		<input type="radio" name="gender" value="Male" {MALE} />
		<span class="gen">{L_MALE}</span>
		<input type="radio" name="gender" value="Undecided" {UNDECIDED} />
		<span class="gen">{L_UNDECIDED}</span></td>
	  </span></td>
	</tr>
	<tr> 
	  <td class="row1"><span class="gen">{L_RACE}</span></td>
	  <td class="row2"> 
		{RACE_SELECT}
	  </td>
	</tr>
	<tr> 
	  <td class="row1"><span class="gen">{L_JOB}</span></td>
	  <td class="row2"> 
		{JOB_SELECT}
	  </td>
	</tr>
	<tr> 
	  <td class="row1"><span class="gen">{L_ELEMENT}</span></td>
	  <td class="row2"> 
		{ELEMENT_SELECT}
	  </td>
	</tr>
    	<tr> 
	  <td class="row1"><span class="gen">{L_ALIGNMENT}:</span></td>
	  <td class="row2"><span class="gensmall">
	  	<input type="radio" name="alignment" value="Good" {GOOD} />
		<span class="gen">{L_GOOD}</span>&nbsp;&nbsp; 
		<input type="radio" name="alignment" value="Evil" {EVIL} />
		<span class="gen">{L_EVIL}</span>
		<input type="radio" name="alignment" value="Neutral" {NEUTRAL} />
		<span class="gen">{L_NEUTRAL}</span></td>
	  </span></td>
	</tr>
	<tr> 
	  <td class="row1"><span class="gen">{L_LVL}</span></td>
	  <td class="row2"> 
		<input class="post" type="text" name="lvl" size="10" maxlength="15" value="{LVL}" />
	  </td>
	</tr>
	<tr> 
	  <td class="row1"><span class="gen">{L_SPECIAL_MOVE}:</span></td>
	  <td class="row2"> 
		<input type="text" name="special_move" class="post" style="width: 200px"  size="10" maxlength="15" value="{SPECIAL_MOVE}" />
	  </td>
	</tr>
	<tr> 
	  <td class="row1"><span class="gen">{L_LCHAR_EDIT}:</span></td>
	  <td class="row2"><span class="gensmall"><select name="lchar" onchange="update_lchar(this.options[selectedIndex].value);"><option value="{CURRENT_L_IMAGE}" selected="selected">{CURRENT_L_IMAGE}</option>{S_L_FILENAME_OPTIONS}</select> &nbsp; <img name="lchar" src="{LCHAR_IMG}" border="0" alt="" /> &nbsp;</span></td>
	</tr>
	<tr> 
	  <td class="row1"><span class="gen">{L_RCHAR_EDIT}:</span></td>
	  <td class="row2"><span class="gensmall"><select name="rchar" onchange="update_rchar(this.options[selectedIndex].value);"><option value="{CURRENT_R_IMAGE}" selected="selected">{CURRENT_R_IMAGE}</option>{S_R_FILENAME_OPTIONS}</select> &nbsp; <img name="rchar" src="{RCHAR_IMG}" border="0" alt="" /> &nbsp;</span></td>
	</tr>
	<tr> 
	  <td class="row1"><span class="gen">{L_BGMUSIC}:</span></td>
	  <td class="row2"><span class="gensmall">
	  	<input type="radio" name="bgmusic" value="1" {BGMUSIC_ON} />
		<span class="gen">{L_YES}</span>&nbsp;&nbsp; 
		<input type="radio" name="bgmusic" value="0" {BGMUSIC_OFF} />
		<span class="gen">{L_NO}</span>
	  </span></td>
	</tr>
	<tr> 
	  <td class="row1"><span class="gen">{L_RAND_BATTLES}:</span></td>
	  <td class="row2"><span class="gensmall">
	  	<input type="radio" name="rand_battles" value="1" {RAND_BATTLES_ON} />
		<span class="gen">{L_YES}</span>&nbsp;&nbsp; 
		<input type="radio" name="rand_battles" value="0" {RAND_BATTLES_OFF} />
		<span class="gen">{L_NO}</span>
	  </span></td>
	</tr>
	<tr> 
	  <td class="row1"><span class="gen">{L_MAX_ITEMS}</span></td>
	  <td class="row2"> 
		<input class="post" type="text" name="max_items" size="10" maxlength="15" value="{MAX_ITEMS}" />
	  </td>
	</tr>
	<tr> 
	  <td class="row1"><span class="gen">{L_BWINS}</span></td>
	  <td class="row2"> 
		<input class="post" type="text" name="bwins" size="10" maxlength="15" value="{BWINS}" />
	  </td>
	</tr>
	<tr> 
	  <td class="row1"><span class="gen">{L_BLOSES}</span></td>
	  <td class="row2"> 
		<input class="post" type="text" name="bloses" size="10" maxlength="15" value="{BLOSES}" />
	  </td>
	</tr>
	<tr> 
	  <td class="row1"><span class="gen">{L_EXP}</span></td>
	  <td class="row2"> 
		<input class="post" type="text" name="exp" size="10" maxlength="15" value="{EXP}" />
	  </td>
	</tr>
	<tr> 
	  <td class="row1"><span class="gen">{L_MAX_EXP}</span></td>
	  <td class="row2"> 
		<input class="post" type="text" name="max_exp" size="10" maxlength="15" value="{MAX_EXP}" />
	  </td>
	</tr>
	<tr> 
	  <td class="row1"><span class="gen">{L_LIMIT}</span></td>
	  <td class="row2"> 
		<input class="post" type="text" name="limit" size="10" maxlength="15" value="{LIMIT}" />
	  </td>
	</tr>
	<tr> 
	  <td class="row1"><span class="gen">{L_HP}</span></td>
	  <td class="row2"> 
		<input class="post" type="text" name="hp" size="10" maxlength="15" value="{HP}" />
	  </td>
	</tr>
	<tr> 
	  <td class="row1"><span class="gen">{L_MAX_HP}</span></td>
	  <td class="row2"> 
		<input class="post" type="text" name="max_hp" size="10" maxlength="15" value="{MAX_HP}" />
	  </td>
	</tr>
	<tr> 
	  <td class="row1"><span class="gen">{L_MP}</span></td>
	  <td class="row2"> 
		<input class="post" type="text" name="mp" size="10" maxlength="15" value="{MP}" />
	  </td>
	</tr>
	<tr> 
	  <td class="row1"><span class="gen">{L_MAX_MP}</span></td>
	  <td class="row2"> 
		<input class="post" type="text" name="max_mp" size="10" maxlength="15" value="{MAX_MP}" />
	  </td>
	</tr>
	<tr> 
	  <td class="row1"><span class="gen">{L_PP}</span></td>
	  <td class="row2"> 
		<input class="post" type="text" name="pp" size="10" maxlength="15" value="{PP}" />
	  </td>
	</tr>
	<tr> 
	  <td class="row1"><span class="gen">{L_MAX_PP}</span></td>
	  <td class="row2"> 
		<input class="post" type="text" name="max_pp" size="10" maxlength="15" value="{MAX_PP}" />
	  </td>
	</tr>
	<tr> 
	  <td class="row1"><span class="gen">{L_ATK}</span></td>
	  <td class="row2"> 
		<input class="post" type="text" name="atk" size="10" maxlength="15" value="{ATK}" />
	  </td>
	</tr>
	<tr> 
	  <td class="row1"><span class="gen">{L_MG_ATK}</span></td>
	  <td class="row2"> 
		<input class="post" type="text" name="mg_atk" size="10" maxlength="15" value="{MG_ATK}" />
	  </td>
	</tr>
	<tr> 
	  <td class="row1"><span class="gen">{L_DEF}</span></td>
	  <td class="row2"> 
		<input class="post" type="text" name="def" size="10" maxlength="15" value="{DEF}" />
	  </td>
	</tr>
	<tr> 
	  <td class="row1"><span class="gen">{L_MG_DEF}</span></td>
	  <td class="row2"> 
		<input class="post" type="text" name="mg_def" size="10" maxlength="15" value="{MG_DEF}" />
	  </td>
	</tr>
	<tr> 
	  <td class="catsides" colspan="2">&nbsp;</td>
	</tr>
	<!-- ENDING RPG PLUS -->

#
#-----[ FIND ]------------------------------------------
#

	<tr> 
	  <td class="row1" colspan="2"><span class="gensmall">{L_SPECIAL_EXPLAIN}</span></td>
	</tr>

#
#-----[ AFTER, ADD ]------------------------------------------
#

	<tr> 
	  <td class="row1"><span class="gen">{L_POINTS}</span></td>
	  <td class="row2"> 
		<input type="text" name="points" maxlength="12" value="{POINTS}" size="12" />
	  </td>
	</tr>
	<tr> 
	  <td class="row1"><span class="gen">{L_ALLOW_POINTS}</span></td>
	  <td class="row2"> 
		<input type="radio" name="allow_points" value="1" {ALLOW_POINTS_YES} />
		<span class="gen">{L_YES}</span>&nbsp;&nbsp; 
		<input type="radio" name="allow_points" value="0" {ALLOW_POINTS_NO} />
		<span class="gen">{L_NO}</span></td>
	</tr>

#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/memberlist_body.tpl

#
#-----[ FIND ]------------------------------------------
#

	  <th class="thTop" nowrap="nowrap">{L_POSTS}</th>
	
#
#-----[ AFTER, ADD ]------------------------------------------
#

	  <th class="thTop" nowrap="nowrap">{L_LEVEL}</th>
	  <th class="thTop" nowrap="nowrap">{L_POINTS}</th>

#
#-----[ FIND ]------------------------------------------
#

	  <td class="{memberrow.ROW_CLASS}" align="center" valign="middle"><span class="gen">{memberrow.POSTS}</span></td>
	  
#
#-----[ AFTER, ADD ]------------------------------------------
#

	  <td class="{memberrow.ROW_CLASS}" align="center" valign="middle"><span class="gen">{memberrow.LEVEL}</span></td>
	  <td class="{memberrow.ROW_CLASS}" align="center" valign="middle"><span class="gen">{memberrow.POINTS}</span></td>
	   
#
#-----[ FIND ]------------------------------------------
#

	  <td class="catBottom" colspan="8" height="28">&nbsp;</td>

#
#-----[ REPLACE WITH ]------------------------------------------
#
	  
	  <td class="catBottom" colspan="10" height="28">&nbsp;</td>
	  
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/overall_header.tpl

#
#-----[ FIND ]------------------------------------------
#

						<td align="center" valign="top" nowrap="nowrap"><span class="mainmenu">&nbsp;<a href="{U_FAQ}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_faq.gif" width="12" height="13" border="0" alt="{L_FAQ}" hspace="3" />{L_FAQ}</a></span><span class="mainmenu">&nbsp; &nbsp;<a href="{U_SEARCH}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_search.gif" width="12" height="13" border="0" alt="{L_SEARCH}" hspace="3" />{L_SEARCH}</a>&nbsp; &nbsp;<a href="{U_MEMBERLIST}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_members.gif" width="12" height="13" border="0" alt="{L_MEMBERLIST}" hspace="3" />{L_MEMBERLIST}</a>&nbsp; &nbsp;<a href="{U_GROUP_CP}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_groups.gif" width="12" height="13" border="0" alt="{L_USERGROUPS}" hspace="3" />{L_USERGROUPS}</a>&nbsp; 

#
#-----[ AFTER, ADD ]------------------------------------------
#

						<!-- BEGIN rpg_links -->
						&nbsp;<a href="{U_RPGWORLD}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_rpgworld.gif" width="12" height="13" border="0" alt="{RPGWORLD}" hspace="3" />{RPGWORLD}</a></span>&nbsp;
						<!-- END rpg_links -->

#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/profile_add_body.tpl

#
#-----[ FIND ]------------------------------------------
#

	<tr> 
	  <th class="thSides" colspan="2" height="25" valign="middle">{L_PREFERENCES}</th>
	</tr>

#
#-----[ AFTER, ADD ]------------------------------------------
#

	<!-- RPG PLUS -->
	<tr> 
	  <td class="row1"><span class="gen">{L_IN_RPG}</span></td>
	  <td class="row2"><span class="gensmall">
	  	<input type="radio" name="in_rpg" value="1" {RPG_ON} />
		<span class="gen">{L_YES}</span>&nbsp;&nbsp; 
		<input type="radio" name="in_rpg" value="0" {RPG_OFF} />
		<span class="gen">{L_NO}</span></td>
	  </span></td>
	</tr>
	<!-- ENDING RPG PLUS -->

#
#-----[ FIND ]------------------------------------------
#

		<span class="gen">{L_NO}</span></td>
	</tr>

#
#-----[ AFTER, ADD ]------------------------------------------
#

	<tr> 
	  <td class="row1"><span class="gen">{L_NOTIFY_DONATION}:</span><br />
		<span class="gensmall">{L_NOTIFY_DONATION_EXPLAIN}</span></td>
	  <td class="row2"> 
		<input type="radio" name="notifydonation" value="1" {NOTIFY_DONATION_YES} />
		<span class="gen">{L_YES}</span>&nbsp;&nbsp; 
		<input type="radio" name="notifydonation" value="0" {NOTIFY_DONATION_NO} />
		<span class="gen">{L_NO}</span></td>
	</tr>

#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/profile_view_body.tpl

#
#-----[ FIND ]------------------------------------------
#

		  <td> <b><span class="gen">{INTERESTS}</span></b></td>
		</tr>

#
#-----[ AFTER, ADD ]------------------------------------------
#

		<tr>
		  <td valign="top" align="right" nowrap="nowrap"><span class="gen">{L_POINTS}:</span></td>
		  <td><b><span class="gen">{POINTS}</span></b><span class="genmed">{DONATE_POINTS}</span></td>
		</tr>

#
#-----[ FIND ]------------------------------------------
#

		<tr> 
		  <td valign="middle" nowrap="nowrap" align="right"><span class="gen">{L_PM}:</span></td>
		  <td class="row1" valign="middle"><b><span class="gen">{PM_IMG}</span></b></td>
		</tr>

#
#-----[ AFTER, ADD ]------------------------------------------
#

		<!-- BEGIN rpgprofile -->
		<tr>
		<td valign="middle" nowrap="nowrap" align="right"><span class="gen">{L_RPG_PROFILE}:</span></td>
		  <td class="row1" valign="middle"><b><span class="gen">{RPG_PROFILE}</span></td>
		</tr>
		<!-- END rpgprofile -->

#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/subSilver.cfg

#
#-----[ FIND ]------------------------------------------
#

$images['icon_newest_reply'] = "$current_template_images/icon_newest_reply.gif";

#
#-----[ AFTER, ADD ]------------------------------------------
#

// RPG PLUS
$images['icon_rpg_profile'] = "$current_template_images/{LANG}/icon_rpg_profile.gif";
// END RPG PLUS

#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/viewtopic_body.tpl

#
#-----[ FIND ]------------------------------------------
#

	<!-- BEGIN postrow -->
	<tr> 
		<td width="150" align="left" valign="top" class="{postrow.ROW_CLASS}">

#
#-----[ IN-LINE FIND ]------------------------------------------ 
#

</td>

#
#-----[ IN-LINE BEFORE, ADD ]------------------------------------------ 
#

<!-- 

#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------ 
#

-->
 
#
#-----[ FIND ]------------------------------------------
#

		<td class="{postrow.ROW_CLASS}" width="100%" height="28" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">

#
#-----[ BEFORE, ADD ]------------------------------------------ 
#

		<!-- BEGIN rpgprofile -->
			<br/>
			<table width='140' border='1px' bordercolor='#D1D7DC' cellspacing='0' cellpadding='0'>
				 <tr>
		  			<td align='center' height='20' colspan='2' class='catLeft'><span class='postdetails'>&nbsp;<b>{postrow.rpgprofile.RPGNAME}</b>&nbsp;</span></td>
		 		</tr>
		 		<tr>
		  			<td width='50%' height='20' align='center'><span class='postdetails'>&nbsp;{postrow.rpgprofile.GENDER}&nbsp;</span></td>
		  			<td height='20' align='center'><span class='postdetails'>&nbsp;{postrow.rpgprofile.ELEMENT}&nbsp;</span></td>
			 	</tr>
			 	<tr>
		 	 		<td width='50%' height='20' align='center'><span class='postdetails'>&nbsp;{postrow.rpgprofile.RACE}&nbsp;</span></td>
		  			<td height='20' align='center'><span class='postdetails'>&nbsp;{postrow.rpgprofile.JOB}&nbsp;</span></td>
		 		</tr>
		 		<tr>
		  			<td width='50%' height='20' align='center'><span class='postdetails'>&nbsp;{postrow.rpgprofile.ALIGNMENT}&nbsp;</span></td>
		  			<td height='20' align='center'><span class='postdetails'>&nbsp;{postrow.rpgprofile.LEVEL}&nbsp;</span></td>
		 		</tr>
		 		<tr>
		  			<td height='20' align='center' colspan="2"><span class='postdetails'>&nbsp;{postrow.rpgprofile.POINTS}{postrow.rpgprofile.DONATE_POINTS}&nbsp;</span></td>
		 		</tr>
			</table><br />
		<!-- END rpgprofile -->
		<!-- BEGIN lstats -->
		<table width='140' border='1px' bordercolor='#D1D7DC' cellspacing='0' cellpadding='0'>
		 <tr>
		  <td align='center' height='20' colspan='2' class='catLeft' bgcolor='#D1D7DC'><span class='postdetails'><b> - Stats - </b></span></td>
		 </tr>
		 <tr>
			<td>
		  		<table width='140' cellspacing='0' cellpadding='0'><tr><td height='2'></td></tr>
					<tr>
						<td width='150' colspan='3' align='center'><span class='postdetails'>HP: {postrow.lstats.HP}/{postrow.lstats.MAX_HP}</span></td>
					</td>
					<tr>
						<td width='25' height='14' align='right'><img src='templates/subSilver/images/hp_bar_start.gif' height='13' width='7' align='center' ></td>
		  				<td width='110' align='left' height='14' align='center' background='templates/subSilver/images/bar_bg.gif'><img src='templates/subSilver/images/hp_bar.gif' height='13' width='{postrow.lstats.HP_BAR}' alt='{postrow.lstats.HP}/{postrow.lstats.MAX_HP}'><img src='templates/subSilver/images/hp_bar_end.gif' height='13' width='7'></td><td width='15'></td>		
					</tr>
					<tr>
						<td width='150' colspan='3' align='center'><span class='postdetails'>MP: {postrow.lstats.MP}/{postrow.lstats.MAX_MP}</span></td>
					</td>
		 			<tr>
						<td width='25' height='14' align='right'><img src='templates/subSilver/images/mp_bar_start.gif' height='13' width='7' align='center' ></td>
		  				<td width='110' height='14' align='left' align='center' background='templates/subSilver/images/bar_bg.gif'><img src='templates/subSilver/images/mp_bar.gif' height='13' width='{postrow.lstats.MP_BAR}' alt='{postrow.lstats.MP}/{postrow.lstats.MAX_MP}'><img src='templates/subSilver/images/mp_bar_end.gif' height='13' width='7'></td><td width='15'></td>
					</tr>
					<tr>
						<td width='150' colspan='3' align='center'><span class='postdetails'>PP: {postrow.lstats.PP}/{postrow.lstats.MAX_PP}</span></td>
					</td>
		 			<tr>
						<td width='25' height='14' align='right'><img src='templates/subSilver/images/pp_bar_start.gif' height='13' width='7' align='center' ></td>
		  				<td width='110' height='14' align='left' align='center' background='templates/subSilver/images/bar_bg.gif'><img src='templates/subSilver/images/pp_bar.gif' height='13' width='{postrow.lstats.PP_BAR}' alt='{postrow.lstats.PP}/{postrow.lstats.MAX_PP}'><img src='templates/subSilver/images/pp_bar_end.gif' height='13' width='7'></td><td width='15'></td>
					</tr>
					<tr>
						<td width='150' colspan='3' align='center'><span class='postdetails'>EXP: {postrow.lstats.EXP}%</span></td>
					</td>
		 			<tr>
						<td width='25' height='14' align='right'><img src='templates/subSilver/images/exp_bar_start.gif' height='13' width='7' align='center' ></td>
		  				<td width='110' align='left' height='14' align='center' background='templates/subSilver/images/bar_bg.gif'><img src='templates/subSilver/images/exp_bar.gif' height='13' width='{postrow.lstats.EXP}' alt='{postrow.lstats.EXP}%'><img src='templates/subSilver/images/exp_bar_end.gif' height='13' width='7'></td><td width='15'></td>
					</tr>
				</table>
			</td>
		</tr>
		</table><br />
		<!-- END lstats -->
		</td>
		
#
#-----[ FIND ]------------------------------------------
#

		<td class="{postrow.ROW_CLASS}" width="100%" height="28" valign="bottom" nowrap="nowrap"><table cellspacing="0" cellpadding="0" border="0" height="18" width="18">
			<tr> 
				<td valign="middle" nowrap="nowrap">

#
#-----[ IN-LINE FIND ]------------------------------------------ 
#

{postrow.PROFILE_IMG}

#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------ 
#

 {postrow.RPG_PROFILE_IMG}

#
#-----[ FIND ]------------------------------------------
#

				//--></script><noscript>{postrow.ICQ_IMG}</noscript></td>
			</tr>
		</table></td>
	</tr>

#
#-----[ AFTER, ADD ]------------------------------------------
#

	<!-- BEGIN bstats -->
	<tr>
		<td align="center" class="{postrow.ROW_CLASS}" colspan="2"><span class="postbody">
				<table cellspacing='0' cellpadding='0'>
					<tr>
						<td width='150' colspan='3' align='center'><span class='postdetails'>HP: {postrow.bstats.HP}/{postrow.bstats.MAX_HP}</span></td>
						<td width='150' colspan='3' align='center'><span class='postdetails'>MP: {postrow.bstats.MP}/{postrow.bstats.MAX_MP}</span></td>
						<td width='150' colspan='3' align='center'><span class='postdetails'>PP: {postrow.bstats.PP}/{postrow.bstats.MAX_PP}</span></td>
						<td width='150' colspan='3' align='center'><span class='postdetails'>EXP: {postrow.bstats.EXP}%</span></td>
					</tr>
					<tr>
						<td width='25' height='14' align='right'><img src='templates/subSilver/images/hp_bar_start.gif' height='13' width='7' align='center' ></td><td width='110' align='left' height='14' align='center' background='templates/subSilver/images/bar_bg.gif'><img src='templates/subSilver/images/hp_bar.gif' height='13' width='{postrow.bstats.HP_BAR}' alt='{postrow.bstats.HP}/{postrow.bstats.MAX_HP}'><img src='templates/subSilver/images/hp_bar_end.gif' height='13' width='7'></td><td width='15'></td>
						<td width='25' height='14' align='right'><img src='templates/subSilver/images/mp_bar_start.gif' height='13' width='7' align='center' ></td><td width='110' height='14' align='left' align='center' background='templates/subSilver/images/bar_bg.gif'><img src='templates/subSilver/images/mp_bar.gif' height='13' width='{postrow.bstats.MP_BAR}' alt='{postrow.bstats.MP}/{postrow.bstats.MAX_MP}'><img src='templates/subSilver/images/mp_bar_end.gif' height='13' width='7'></td><td width='15'></td>
						<td width='25' height='14' align='right'><img src='templates/subSilver/images/pp_bar_start.gif' height='13' width='7' align='center' ></td><td width='110' height='14' align='left' align='center' background='templates/subSilver/images/bar_bg.gif'><img src='templates/subSilver/images/pp_bar.gif' height='13' width='{postrow.bstats.PP_BAR}' alt='{postrow.bstats.PP}/{postrow.bstats.MAX_PP}'><img src='templates/subSilver/images/pp_bar_end.gif' height='13' width='7'></td><td width='15'></td>
						<td width='25' height='14' align='right'><img src='templates/subSilver/images/exp_bar_start.gif' height='13' width='7' align='center' ></td><td width='110' align='left' height='14' align='center' background='templates/subSilver/images/bar_bg.gif'><img src='templates/subSilver/images/exp_bar.gif' height='13' width='{postrow.bstats.EXP}' alt='{postrow.bstats.EXP}%'><img src='templates/subSilver/images/exp_bar_end.gif' height='13' width='7'></td><td width='15'></td>
					</tr>
				</table>
		</span></td>
	</tr>
	<!-- END bstats -->

#
#-----[ OPEN ]------------------------------------------
#

common.php

#
#-----[ FIND ]------------------------------------------
#

include($phpbb_root_path . 'includes/db.'.$phpEx);

#
#-----[ AFTER, ADD ]------------------------------------------
#

// Points MOD
include($phpbb_root_path . 'includes/functions_points.'.$phpEx);

#
#-----[ OPEN ]------------------------------------------
#
memberlist.php

#
#-----[ FIND ]------------------------------------------
#

$mode_types_text = array(

#
#-----[ IN-LINE FIND ]------------------------------------------ 
#

$lang['Sort_Top_Ten']

#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------ 
#

, $lang['Sort_rpg_level'], $board_config['points_name']

#
#-----[ FIND ]------------------------------------------
#

$mode_types = array(

#
#-----[ IN-LINE FIND ]------------------------------------------ 
#

'topten'

#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------ 
#

,'rpglevel', 'points'

#
#-----[ FIND ]------------------------------------------
#

	'L_PM' => $lang['Private_Message'],

#
#-----[ AFTER, ADD ]------------------------------------------
#

	// RPG PLUS
	'L_LEVEL' => $lang['Sort_rpg_level'],
	// Points MOD
	'L_POINTS' => $board_config['points_name'],
	
#
#-----[ FIND ]------------------------------------------
#

	case 'topten':
		$order_by = "user_posts $sort_order LIMIT 10";
		break;
		
#
#-----[ AFTER, ADD ]------------------------------------------
#
	// RPG PLUS
	case 'rpglevel':
		$order_by = "user_lvl $sort_order LIMIT $start, " . $board_config['topics_per_page'];
		break;
	// Points MOD
	case 'points':
		$order_by = "user_points $sort_order LIMIT $start," . $board_config['topics_per_page'];
		break;

#
#-----[ FIND ]------------------------------------------
#

		$sql = "SELECT username,
		
#
#-----[ IN-LINE FIND ]------------------------------------------ 
#

user_allowavatar

#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------ 
#

, user_lvl, user_points

#
#-----[ FIND ]------------------------------------------
#

		$search = '<a href="' . $temp_url . '">' . $lang['Search_user_posts'] . '</a>';
		
#
#-----[ AFTER, ADD ]------------------------------------------
#

		// RPG PLUS
		$user_rpglevel= $row['user_lvl'];
		// Points MOD
		$user_points = $row['user_points'];

#
#-----[ FIND ]------------------------------------------
#

			'YIM' => $yim,
			
#
#-----[ AFTER, ADD ]------------------------------------------
#

			// RPG PLUS
			'LEVEL' => $user_rpglevel,
			// Points MOD
			'POINTS' => $user_points,
			
#
#-----[ OPEN ]------------------------------------------
#
posting.php

#
#-----[ FIND ]------------------------------------------
#

include($phpbb_root_path . 'includes/functions_post.'.$phpEx);

#
#-----[ AFTER, ADD ]------------------------------------------
#

// RPG PLUS
include($phpbb_root_path . 'includes/functions_rpgstats.'.$phpEx);
// END RPG PLUS

#
#-----[ OPEN ]------------------------------------------
#
viewforum.php

#
#-----[ FIND ]------------------------------------------
#

//
// Start session management
//
$userdata = session_pagestart($user_ip, $forum_id);
init_userprefs($userdata);
//
// End session management
//

#
#-----[ AFTER, ADD ]------------------------------------------
#

// RPG PLUS
// Battles on?
if(($forum_row['forum_battles'] != 0) && ($board_config['rand_battles']) && ($userdata['user_in_rpg']) && ($userdata['user_rand_battles']))
{
	// random battle?
	srand((double) microtime() * 1000000);
	$rand = rand(0, 100);
	if($rand < $forum_row['forum_battles'])
	{
		// ahhh!!! Run away!!! 
		$message = $lang['Been_attacked'] . '<br /><br />' . sprintf($lang['Click_to_fight'], '<a href="' . append_sid($phpbb_root_path . "arena." . $phpEx . "?mode=rand_battle") . '">', '</a>') .'<br /><br />' . sprintf($lang['Click_to_run'], '<a href="' . append_sid($phpbb_root_path . 'viewforum.' . $phpEx . '?' . POST_FORUM_URL . '=' . $forum_id) . '">', '</a>') . '<br /><br />';
		message_die(GENERAL_MESSAGE, $message);
	}
}
// END RPG PLUS

#
#-----[ OPEN ]------------------------------------------
#
viewonline.php

#
#-----[ FIND ]------------------------------------------
#

				case PAGE_FAQ:
					$location = $lang['Viewing_FAQ'];
					$location_url = "faq.$phpEx";
					break;

#
#-----[ AFTER, ADD ]------------------------------------------
#

				// RPG PLUS
				case PAGE_ARENA:
					$location = $lang['Viewing_arena'];
					$location_url = "arena.$phpEx";
					break;
				case PAGE_HOSPITAL:
					$location = $lang['Viewing_hospital'];
					$location_url = "hospital.$phpEx";
					break;
				case PAGE_RPGSHOP:
					$location = $lang['Viewing_rpgshop'];
					$location_url = "rpgshop.$phpEx";
					break;
				case PAGE_RPGHOME:
					$location = $lang['Viewing_rpghome'];
					$location_url = "rpgcp.$phpEx";
					break;
				case PAGE_RPGPROFILE:
					$location = $lang['Viewing_rpgprofile'];
					$location_url = "index.$phpEx";
					break;
				case PAGE_RPGWORLD:
					$location = $lang['Viewing_rpgworld'];
					$location_url = "rpg.$phpEx";
					break;
				case PAGE_RPGSTATS:
					$location = $lang['Viewing_rpgstats'];
					$location_url = "rpgstats.$phpEx";
					break;
				case PAGE_RPGHELP:
					$location = $lang['Viewing_rpghelp'];
					$location_url = "rpghelp.$phpEx";
					break;
				// END RPG PLUS
		
#
#-----[ OPEN ]------------------------------------------
#
viewtopic.php

#
#-----[ FIND ]------------------------------------------
#

$sql = "SELECT t.topic_id, t.topic_title, t.topic_status, t.topic_replies,

#
#-----[ IN-LINE FIND ]------------------------------------------ 
#

f.auth_vote,

#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------ 
#

f.in_rpg, f.forum_battles,

#
#-----[ FIND ]------------------------------------------
#

//
// Start session management
//
$userdata = session_pagestart($user_ip, $forum_id);
init_userprefs($userdata);
//
// End session management
//

#
#-----[ AFTER, ADD ]------------------------------------------
#

// RPG PLUS
// Battles on?
if(($forum_topic_data['forum_battles'] != 0) && ($board_config['rand_battles']) && ($userdata['user_in_rpg']) && ($userdata['user_rand_battles']))
{
	// random battle?
	srand((double) microtime() * 1000000);
	$rand = rand(0, 100);
	if($rand < $forum_topic_data['forum_battles'])
	{
		// get proper message
		if((isset($post_id)) && ($post_id != 0))
		{
			$message = $lang['Been_attacked'] . '<br /><br />' . sprintf($lang['Click_to_fight'], '<a href="' . append_sid($phpbb_root_path . "arena." . $phpEx . "?mode=rand_battle") . '">', '</a>') .'<br /><br />' . sprintf($lang['Click_to_run'], '<a href="' . append_sid($phpbb_root_path . 'viewtopic.' . $phpEx . '?' . POST_POST_URL . '=' . $post_id .'#' . $post_id) . '">', '</a>') . '<br /><br />';
		}
		else
		{
			$message = $lang['Been_attacked'] . '<br /><br />' . sprintf($lang['Click_to_fight'], '<a href="' . append_sid($phpbb_root_path . "arena." . $phpEx . "?mode=rand_battle") . '">', '</a>') .'<br /><br />' . sprintf($lang['Click_to_run'], '<a href="' . append_sid($phpbb_root_path . 'viewtopic.' . $phpEx . '?' . POST_TOPIC_URL . '=' . $topic_id) . '">', '</a>') . '<br /><br />';
		}
		
		// ahhh!!! Run away!!! 
		message_die(GENERAL_MESSAGE, $message);
	}
}
// END RPG PLUS

#
#-----[ FIND ]------------------------------------------
#

//
// Go ahead and pull all data for this topic
//
$sql = "SELECT u.username, u.user_id, u.user_posts,

#
#-----[ IN-LINE FIND ]------------------------------------------ 
#

u.user_allowsmile,

#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------ 
#

u.user_rpgname, u.user_gender, u.user_race, u.user_exp, u.user_lvl, u.user_job, u.user_element, u.user_alignment, u.user_max_exp, u.user_hp, u.user_max_hp, u.user_mp, u.user_max_mp,  u.user_pp, u.user_max_pp, u.user_points,

#
#-----[ FIND ]------------------------------------------
#

		$yim_img = ( $postrow[$i]['user_yim'] ) ? '<a href="http://edit.yahoo.com/config/send_webmesg?.target=' . $postrow[$i]['user_yim'] . '&amp;.src=pg"><img src="' . $images['icon_yim'] . '" alt="' . $lang['YIM'] . '" title="' . $lang['YIM'] . '" border="0" /></a>' : '';
		$yim = ( $postrow[$i]['user_yim'] ) ? '<a href="http://edit.yahoo.com/config/send_webmesg?.target=' . $postrow[$i]['user_yim'] . '&amp;.src=pg">' . $lang['YIM'] . '</a>' : '';

#
#-----[ AFTER, ADD ]------------------------------------------
#

		// RPG PLUS
		$where_id = intval($HTTP_GET_VARS['t']);
		$temp_url = append_sid($phpbb_root_path . "rpgcp.$phpEx?mode=view&amp;where=topic&amp;where_id=$where_id&amp;id=$poster_id");
		if($userdata['user_in_rpg'] && $forum_topic_data['in_rpg']  && $userdata['session_logged_in'])
		{
			$rpg_profile_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_rpg_profile'] . '" alt="" title="" border="0" /></a>';
		}
		else
		{
			$rpg_profile_img = '';
		}
		// END RPG PLUS

#
#-----[ FIND ]------------------------------------------
#

		$yim = '';

#
#-----[ AFTER, ADD ]------------------------------------------
#

		// RPG PLUS
		$rpg_profile_img = '';
		// END RPG PLUS

#
#-----[ FIND ]------------------------------------------
#

	$user_sig_bbcode_uid = $postrow[$i]['user_sig_bbcode_uid'];

#
#-----[ AFTER, ADD ]------------------------------------------
#

	// RPG PLUS	
	if ($poster_id != ANONYMOUS)
	{
		$rpgname = ($postrow[$i]['user_rpgname']) ? $postrow[$i]['user_rpgname']  : '-';
		$gender = ($postrow[$i]['user_gender']) ? $postrow[$i]['user_gender'] : '-';
		$race =  ($postrow[$i]['user_race']) ? $postrow[$i]['user_race']: '-';
		$job =  ($postrow[$i]['user_job']) ? $postrow[$i]['user_job'] : '-';
    		$element =  ($postrow[$i]['user_element']) ? $postrow[$i]['user_element'] : '-';
    		$alignment = ($postrow[$i]['user_alignment']) ? $postrow[$i]['user_alignment'] : '-';
		$exp = intval($postrow[$i]['user_exp'] / $postrow[$i]['user_max_exp'] *100);
		$hp = intval($postrow[$i]['user_hp'] / $postrow[$i]['user_max_hp'] *100);
		$mp = intval($postrow[$i]['user_mp'] / $postrow[$i]['user_max_mp'] *100);
		$pp = intval($postrow[$i]['user_pp'] / $postrow[$i]['user_max_pp'] *100);
		$level =  $lang['level'] . ': '  . $postrow[$i]['user_lvl'];

		// Points MOD
		$user_points = ($userdata['user_level'] == ADMIN || user_is_authed($userdata['user_id'])) ? '<a href="' . append_sid("pointscp.$phpEx?" . POST_USERS_URL . "=" . $postrow[$i]['user_id']) . '" class="gensmall" title="' . sprintf($lang['Points_link_title'], $board_config['points_name']) . '">' . $board_config['points_name'] . '</a>' : $board_config['points_name'];
		$user_points = '<br />' . $user_points . ': ' . $postrow[$i]['user_points'];

		if ($board_config['points_donate'] && $userdata['user_id'] != ANONYMOUS && $userdata['user_id'] != $poster_id)
		{
			$donate_points = '<br />' . sprintf($lang['Points_donate'], '<a href="' . append_sid("pointscp.$phpEx?mode=donate&amp;" . POST_USERS_URL . "=" . $postrow[$i]['user_id']) . '" class="gensmall" title="' . sprintf($lang['Points_link_title_2'], $board_config['points_name']) . '">', '</a>');
		}
		else
		{
			$donate_points = '';
		}
	}
	else
	{
		$rpgname = '';
		$gender = '';
		$race =  '';
		$job =  '';
    		$element =  '';
    		$alignment = '';
		$exp = 0;
		$hp = 0;
		$mp = 0;
		$pp = 0;
		$level =  0;

		// Points MOD
		$user_points = '';
		$donate_points = '';
	}
	// END RPG PLUS

#
#-----[ FIND ]------------------------------------------
#

		'DELETE' => $delpost,

#
#-----[ AFTER, ADD ]------------------------------------------
#

		// RPG PLUS
		'RPG_PROFILE_IMG' => $rpg_profile_img,
		// END RPG PLUS

#
#-----[ FIND ]------------------------------------------
#

		'U_POST_ID' => $postrow[$i]['post_id'])
	);

#
#-----[ AFTER, ADD ]------------------------------------------
#

	// RPG PLUS
	if ($poster_id != ANONYMOUS && $forum_topic_data['in_rpg'] && $userdata['user_in_rpg'] && $userdata['session_logged_in'])
	{
		if ($board_config['rpgprofile_on_topic'] == "on")
		{
			$template->assign_block_vars('postrow.rpgprofile', array(
				'RPGNAME' => $rpgname,
				'GENDER' => $gender,
				'RACE' => $race,
				'JOB' => $job,
    				'ELEMENT' => $element,
    				'ALIGNMENT' => $alignment,
				'LEVEL' => $level,
				// Points MOD
				'POINTS' => $user_points,
				'DONATE_POINTS' => $donate_points,
				)
			);
		}
		if ($board_config['rpgstats_align'] == "left" && $board_config['rpgstats_on_topic'] == "on")
		{
			$template->assign_block_vars('postrow.lstats', array(
					'HP' => $postrow[$i]['user_hp'],
					'MAX_HP' => $postrow[$i]['user_max_hp'],
					'HP_BAR' => $hp,
					'MP' => $postrow[$i]['user_mp'],
					'MAX_MP' => $postrow[$i]['user_max_mp'],
					'MP_BAR' => $mp,
					'PP' => $postrow[$i]['user_pp'],
					'MAX_PP' => $postrow[$i]['user_max_pp'],
					'PP_BAR' => $pp,
					'EXP' => $exp,
				)
			);
		}
		elseif($board_config['rpgstats_on_topic']== "on" && $board_config['rpgstats_align'] == "bottom")
		{
			$template->assign_block_vars('postrow.bstats', array(
					'HP' => $postrow[$i]['user_hp'],
					'MAX_HP' => $postrow[$i]['user_max_hp'],
					'HP_BAR' => $hp,
					'MP' => $postrow[$i]['user_mp'],
					'MAX_MP' => $postrow[$i]['user_max_mp'],
					'MP_BAR' => $mp,
					'PP' => $postrow[$i]['user_pp'],
					'MAX_PP' => $postrow[$i]['user_max_pp'],
					'PP_BAR' => $pp,
					'EXP' => $exp,
				)
			);	
		}
	}
	// END RPG PLUS

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM